<!DOCTYPE html>

<html lang="en">

<head>

	<meta charset="UTF-8" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui"  name="viewport">

	<title>活动信息</title>

	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<link rel="stylesheet" href="../addons/zh_hkad/template/mobile/css/weui.min.css">

	<link rel="stylesheet" href="../addons/zh_hkad/template/mobile/css/jquery-weui.css">
<script src="http://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>

    <script src="../addons/zh_hkad/template/mobile/js/jquery-2.1.4.js"></script>

	<script src="../addons/zh_hkad/template/mobile/js/jquery-weui.js"></script>	
    <script src="../addons/zh_hkad/template/mobile/js/swiper.js"></script>

	<script src="../addons/zh_hkad/template/mobile/js/fastclick.js"></script>

	<style>

		.swiper-slide img{

			width: 100%;

			height: auto;

		}
      #btn{
      		position: fixed;

			bottom: 0;

			left: 0;

			width: 100%;

			height: 50px;

			text-align: center;;

			line-height: 50px;

			z-index: 10
      }

		#btn h1{

			background: #79b0e8;

			font-size: 16px;

			color: #fff;
          box-shadow:1px 0px 0px #999 inset;
          float:left;

		}

		.nav{
			overflow: hidden;
			width: 80%;
			margin:0 auto;

		}

		.nav li{

			float: left;
			list-style: none;
			text-align: center;
			margin-top: 10px;
			width: 50%;
			padding: 10px 0;

		}

		.nav li.active{

			color: #2f8ff3;

		}

		.box{

			margin-bottom: 80px;

			display: none

		}

		.box_on{

			display: block;

		}
		.weui-cells{
			margin:0;
		}
		.weui-cell__bd{

			padding: 10px 0

		}

		.weui-cell__bd span{


			font-size: 14px;

			color: #888;

		}

		.icon{

			position: absolute;

			top:13px;

			right: 30px;

			width: 20px;

			height: 13px;

		}

		.imgs{

			display: none;

			overflow: hidden;

		}

		.head{

			width: 50px;

			height: 50px;

			background: #ccc;

			float: left;

			margin-right: 10px;

			margin-bottom: 10px;

		}

		.money{

			color: red;

			text-align: center;

			float: left;

			font-weight: normal;

			font-size: 14px;

		}

		.con_detail{

			padding: 15px 15px;

		}

		.swiper-container{

			height:250px; 

		}
      .weui-cell:before{
      right:15px;border-top:1px solid #e5e5e5;
      }
      .weui-cells:after{border-bottom:none;}

	</style>

</head>

<body>

	<div class="swiper-container" style="width:100%;height:240px">

      <!-- Additional required wrapper -->

      <div class="swiper-wrapper" style="width:100%;height:240px">

        <!-- Slides -->

        {loop $active['imgs'] $row}

        <div class="swiper-slide silde-img" style="width:100%;height:240px"><img style="width:100%;height:240px;" src="{$_W['attachurl_local']}{$row}" /></div>

        <!-- <div class="swiper-slide"><img src="../addons/zh_hkad/template/mobile/img/swiper-2.jpg" /></div>

        <div class="swiper-slide"><img src="../addons/zh_hkad/template/mobile/img/swiper-3.jpg" /></div> -->

        {/loop}

      </div>

      <!-- If we need pagination -->

      <div class="swiper-pagination"></div>

    </div>



	<!--<ul class="nav">

		<li class="active">活动简介</li>

		<li>活动详情</li>

	</ul>-->

	<!--活动信息-->

	<div class="box box_on">

	    <div class="weui-cells weui-cells_form">

	      <div class="weui-cell weui-cell_vcode">

			<div class="weui-cell__bd">

				<p class="title" style="color:#111;text-align:center;height:36px;line-height:47px;">{$active['title']}</p>

	        </div>

	      </div>

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">活动时间&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['start']}到{$active['end']}</span>

	        </div>

	      </div>
          

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">截止报名&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['stoptime']}</span>

	        </div>

	      </div>

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">活动地址&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['address']}</span>
              	<a class="gps" href="https://uri.amap.com/marker?position={$lnglat}&name={$active['address']}" style="float:right;background-color:#2f8ff3;color:#fff;padding:1px 10px;border-radius:15px;font-size:12px;margin-right:10px;">导航</a>

	        </div>

	      </div>	      

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">主办单位&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['company']}</span>

	        </div>

	      </div>

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">联系电话&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['tel']}</span>
				<a class="call" href="tel:{$active['tel']}" style="float:right;background-color:#2f8ff3;color:#fff;padding:1px 10px;border-radius:15px;font-size:12px;margin-right:10px;">拨打</a>

	        </div>

	      </div>

		 <div class="weui-cell weui-cell_vcode open">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">活动人数&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$active['people']}</span>

	        </div>

	      </div>

		 <div class="weui-cell weui-cell_vcode open">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">参加人数&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$peoples}</span>

	        </div>

	      </div>

		 <div class="weui-cell weui-cell_vcode open">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">剩余名额&nbsp;: </span>

				<span class="" style="float:left;">&nbsp;{$lpeople}</span>

	        </div>

	      </div>

		 <div class="weui-cell weui-cell_vcode imgs">

	        <div class="weui-cell__bd">

	        	{loop $people $row}

				<img src="{$row['imgs']}" alt="" class="head">

	        	{/loop}

	        </div>

	      </div>

	      <div class="weui-cell weui-cell_vcode">

	        <div class="weui-cell__bd">

				<span class="" style="color:#111;float:left;">体检费用&nbsp;: </span>

		      	<b class="money">&nbsp;{$active['money']}元</b>

		      	<input type="hidden" id="money" value="{$active['money']}">

	        </div>

	      </div>
          <div class="weui-cell weui-cell_vcode" style="border-top:7px solid #e5e5e5;">

				<div class="weui-cell__bd weui-content" style="color:#999;font-size:12px;">{$active['content']}</div>

		  </div>

	    </div>

    </div>
    
	<div id="btn">
      <a href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=baoming&m=zh_hkad&id={$active['id']}"><h1 style="width:34%;">已报名</h1></a>
	{if $peoples < $active['people'] && $now<$active['stoptimesjc'] }
  		{if $is['state']==1}
  		<a class="btn"><h1 style="background:#ffa401;width:66%;">您已报名并付款</h1></a>
  		{else}
  		<a href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=regist&m=zh_hkad&id={$active['id']}" class="btn"><h1 style="background:#ffa401;width:66%;">我要参加</h1></a>
  		{/if}
  	{else}
  		<a class="btn tanc"><h1 style="background:#ffa401;width:66%;">我要参加</h1></a>
  	{/if}
    </div>
<script>
  
		

$(function() {
		sessionStorage.setItem("id", window.location.search.split("&id=")[1]);
    	FastClick.attach(document.body);
		var tmdid=window.location.search.split("&id=")[1]
    	var money=$("#money").val()
    	sessionStorage.setItem("moneykey", money);
        $.ajax({

 			url: "{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=share&m=zh_hkad",

            dataType: 'json',

            type: 'POST',

            async: true,
          	data:{id:tmdid},

            success: function (data) {
              	wx.config({

                    debug: false, // 开启调试模式为true后可以通过alert弹窗将公众号签名等结果反馈出来

                    appId: data.appId, // 必填，公众号的唯一标识

                    timestamp: data.timeStamp, // 必填，生成签名的时间戳

                    nonceStr: data.nonceStr, // 必填，生成签名的随机串

                    signature: data.signature,// 必填，签名，见附录1

                    jsApiList: [

                        "onMenuShareTimeline",

                        "onMenuShareAppMessage",//分享给好友

                        "onMenuShareQQ",

                        "onMenuShareWeibo",

                        "onMenuShareQZone"

                    ]

                });
             
            },

            error: function () {



            }

        });
      
    	wx.ready(function () {
           //分享好友
       		  var shareData = {

          		title:`{$active['title']}`,

          		desc:`{php echo mb_substr(strip_tags(htmlspecialchars_decode($active['content'])),0,20,'utf-8')}`,

          		imgUrl:`{$_W['attachurl_local']}{$active['imgs'][0]}`,

          		link: `{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=detail&m=zh_hkad&id=`+tmdid,

      		};
     		//wx.updateAppMessageShareData(shareData);
          	
     		wx.onMenuShareAppMessage(shareData);
   		});

  

    	$(".swiper-container").swiper({

        	loop: true,

        	autoplay: 3000

    	}),

        $(".nav li").click(function(e){

            var index=$(this).index();

            $(".nav li").removeClass("active")

            $(this).addClass("active")

            $(".box").hide()

            $(".box").eq(index).show()

        }),
  
        $(".tanc").click(function(e){

            alert('报名人数已满,或者时间过期！')

        })

})

</script>

</body>

</html>